import Vue from 'vue'
import Vant from 'vant'
import 'vant/lib/index.css'
import VueRouter from 'vue-router'

import Login from '@/views/login'
import Layout from '@/views/layout'
import Home from '@/views/home'
import Question from '@/views/question'
import Video from '@/views/video'
import Users from '@/views/users'
Vue.use(VueRouter)
Vue.use(Vant)

const routes = [
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path: '/',
    name: '',
    component: Layout,
    children: [
      {
        path: '',
        name: 'home',
        component: Home
      },
      {
        path: '/question',
        name: 'question',
        component: Question
      },
      {
        path: '/video',
        name: 'video',
        component: Video
      },
      {
        path: '/users',
        name: 'users',
        component: Users
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
